<?php
require('_config-rating.php');
if($_POST)
{

$q=$_POST['searchword'];

//$sql_res=mysql_query("select * from games where gameName like '%$q%' or lname like '%$q%' order by uid LIMIT 5");
$sql_res=mysql_query("select * from games where gameName like '%$q%' or gameDesc like '%$q%' order by gameId LIMIT 5",$con);
while($row=mysql_fetch_array($sql_res))
{
$fname=$row['gameName'];
$gId=$row['gameId'];
$lname=$row['gameDesc'];
$img=$row['picUrl'];
$country=$row['addedDate'];

$re_fname='<b>'.$q.'</b>';
$re_lname='<b>'.$q.'</b>';

//$final_fname = str_ireplace($q, $re_fname, $fname);

//$final_lname = str_ireplace($q, $re_lname, $lname);


?>
<div class="display_box" id="display_box" align="left">

<img src="<?php echo $img; ?>" style="width:30px;height:30px; float:left; margin-right:6px;margin-left:6px;margin-top:3px;padding-right:5px;" /><a style="float:left;" href="play.php?gameid=<?php echo $gId; ?>&game=<?php echo $fname; ?> "><?php echo $fname; ?></a>
<span style="font-size:9px; color:#999999;margin-top:20px;float:left;margin-top:8px;"><?php echo $country; ?></span></div>



<?php
}

}
else
{

}


?>
